package com.mca.framework.forkjoin;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

/**
 * @Author: zhoupeng
 * @createTime: 2025年07月23日 21:24:22
 * @version: 1.0
 * @Description:
 * @copyright:
 */
public class SumTaskTest {
    public static void main(String[] args) {
        ForkJoinPool pool=new ForkJoinPool();
        ForkJoinTask<Integer> taskFuture = pool.submit(new SumTask.SubTask(1, 1000));
        try {
            Integer result = taskFuture.get();
            System.out.println("result="+result);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
    }
}
